// Read A/D channels for accelerometers and convert to G's
// Read A/D channels for gyros and convert from deg/sec to radians
// All variables defined in main sketch (MikroQuad)

float accelero_x() {
  return (analogRead(XACCELPIN) - xAccMid + xAccZero) * xAccScaleFactor;
}

float accelero_y() {
  return ((analogRead(YACCELPIN) - yAccMid + yAccZero) * yAccScaleFactor);
}

float accelero_z() {
  return (analogRead(ZACCELPIN) - zAccMid + zAccZero) * zAccScaleFactor;
}

float gyro_roll_rad() {
  return ((float)analogRead(XRATEPIN) - GyroMid + xGyroZero) * GyroScaleFactor;
}

float gyro_pitch_rad() {
  return ((float)analogRead(YRATEPIN) - GyroMid + yGyroZero) * GyroScaleFactor;
}

